<?php 
class area
{
	private $area_info = '';
	public function __construct()
	{		
		$this->area_info = unserialize(file_get_contents( 'area.txt','r' ));
	}
	public function isArea( $keyword )
	{	
		$keyword = iconv('gb2312', 'utf-8', $keyword);
		if( isset( $this->area_info[$keyword] ) )
		{
			return $this->area_info[$keyword]; 
		}
		else
		{
			return false;
		}
	}
	
	public function getWeather( $conde )
	{
		$url = 'http://m.weather.com.cn/data/'.$conde.'.html';
		$info = json_decode( file_get_contents($url) );
		
		$city = iconv( 'utf-8','gb2312', $info->weatherinfo->city);
		
		$rel = $city;
		
		return $rel;
		
	}
}

?>